With increasing network traffic, for convenience of network traffic planning, real-time monitoring of a network state, refined charging and traffic control based on application types, and identification and management of some special traffic (for example, malicious traffic identification) to ensure normal use of a network, a current operator or service provider may implement control and management of a streaming service based on the 5-tuple of a packet (a source IP+a source port+a destination IP+a destination port+a protocol number), including detection and identification of a streaming service type, stream-based traffic control, stream-based packet statistics, and so on, through a network operation device (for example, a router, a switch or a service gateway).
In the prior art, a process for the network operation device to control and manage the streaming service is briefly described as follows:
A load sharing module receives a service stream, obtains an allocation identifier of the service stream by using the 5-tuple of a packet-based hash (HASH) algorithm. The load sharing module then forwards, according to allocation ranges of currently valid service nodes, the service stream to a service node corresponding to an allocation range to which the allocation identifier belongs.
The allocation ranges of the currently valid service nodes are ranges obtained by averagely sharing a full set of the allocation identifiers among the currently valid service nodes, where the same number of service streams is allocated to each valid service node.
The service node processes a packet of the service stream and establishes a stream table to instruct forwarding. The capacity of the stream table is large (for example, 20 M to 60 M items), and stream tables between service nodes are backups of each other.
When a service node fails, the number of currently valid nodes is changed, and thereby the allocation ranges of the currently valid nodes are changed accordingly. That is to say, the allocation ranges of the currently valid nodes are ranges obtained by sharing the full set of allocation identifiers again according to the changed number of the currently valid nodes, so a range of streams to be processed by the service nodes is also changed, and a corresponding stream table item or a backup stream table item needs to be established or deleted, which is a process of smoothing a stream table item. In the smoothing process, in order to keep the service uninterrupted, according to a processing range of the currently valid service nodes, an originally existing part of stream table items are migrated to other service boards through the smoothing process for processing. After the smoothing process ends, the load sharing module performs traffic load sharing again according to the number of currently valid service nodes after the failure occurs.
During research and practice of the prior art, the inventor of the present invention finds that, when a service node fails, the number of currently valid service nodes is changed, and thereby the allocation ranges of the currently valid service node are changed accordingly. That is to say, the allocation ranges of the currently valid service node are ranges obtained by averagely sharing the full set of allocation identifiers again according to the changed number of the currently valid nodes, so the range of streams to be processed by the service nodes is also changed. Therefore, in the smoothing process, according to the processing range of the currently valid service nodes, a large number of originally existing stream table items are migrated to other service boards through the smoothing process for processing. These stream table items include not only a backup stream table item of the failed service node but also a part of stream table items of the currently valid service nodes. Since the number of stream table items to be smoothed is large, a large bandwidth is required between service nodes to enable the stream table items to be smoothed to be migrated to other service nodes. Moreover, since the number of the stream table items to be smoothed is large, a long processing time is required, and a large amount of resources are occupied.